package com.steamedfish.auctionsecurityserveroauth2.feign.service;


import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.steamedfish.auctionsecurityserveroauth2.entiry.UserEntiry;
import com.steamedfish.auctionsecurityserveroauth2.mapper.UserMapper;
import org.apache.commons.lang.RandomStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/auctionsecurityserveroauth2/service/userEntiry")
public class UserInfoService {

    @Autowired
    private UserMapper userMapper;

    @RequestMapping(value = "/userinfo")
    @DS("steamed_fish_auction_security")
    public ResponseEntity<?> getUserinfo(@RequestParam String id){
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("id", id);
        queryWrapper.isNotNull("mail");
        UserEntiry userEntiry = userMapper.selectOne(queryWrapper);
        return ResponseEntity.ok(userEntiry);
    }

}